<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>新增用户</title>
</head>
<body>
<form th:action="@{/saveUser}" method="post">
    <p>姓名:<input name="name" th:value="${user?.name}"></p>
    <p>年龄:<input name="age" th:value="${user?.age}"></p>
    <p>电话:<input name="phone" th:value="${user?.phone}"></p>
    <p>所在部门:
        <select name="deptCode">
            <option th:each="d:${departmentList}"
                    th:text="${d.deptName}"
                    th:value="${d.deptCode}"
            >生产部
            </option>
        </select>
    </p>
    <p>
        <button type="submit"> 提交</button>
    </p>
</form>
<p th:text="${msg}"></p>
</body>
</html>